#include "StaticJavaLib.h"
#include "gc.h"
struct For{
};

void For_emptyFor(){
  for(;;){
  }
  gc_recycle();
}

void For_initOnlyFor(){
  int i;
  for(i = 0;;){
  }
  gc_recycle();
}

void For_condOnlyFor(){
  int i;
  i = 0;
  for(;i < 10;){
  }
  gc_recycle();
}

void For_incOrDecOnlyFor(){
  int i;
  i = 0;
  for(;;i++){
  }
  gc_recycle();
}

void For_missingIncOrDecFor(){
  int i;
  for(i = 0;i < 10;){
  }
  gc_recycle();
}

void For_missingCondFor(){
  int i;
  for(i = 0;;i++){
  }
  gc_recycle();
}

void For_missingInitFor(){
  int i;
  i = 0;
  for(;i < 10;i++){
  }
  StaticJavaLib_assertTrue(i == 10);
  gc_recycle();
}

void For_forFor(){
  int i;
  for(i = 0;i < 10;i++){
  }
  StaticJavaLib_assertTrue(i == 10);
  gc_recycle();
}

void For_multipleInitOnlyFor(){
  int i;
  int j;
  int k;
  for(i = 0,j = 0,k = 0;;){
  }
  gc_recycle();
}

void For_multipleIncOrDecOnlyFor(){
  int i;
  int j;
  int k;
  i = 0;
  j = 0;
  k = 0;
  for(;;i++,j++,k++){
  }
  gc_recycle();
}

void For_multipleFor(){
  int i;
  int j;
  int k;
  for(i = 0,j = 0,k = 0;i < 10;i++,j++,k++){
  }
  StaticJavaLib_assertTrue(i == 10);
  StaticJavaLib_assertTrue(j == 10);
  StaticJavaLib_assertTrue(k == 10);
  gc_recycle();
}

void main(int argc,char** argv){
  For_missingInitFor();
  For_forFor();
  For_multipleFor();
  gc_recycle();
}
